package com.iasku.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class IaskuQuestion implements Parcelable {
    private String questionno;      //试题编号
    private int questiontype_id;   //试题类型编号
    private String question_score;  //试题的分值
    private int total;           //提交题目的个数
    private String useranswer = "";      //用户选择的答案
    private String userscore;       //用户的得分
    private String answerid;        //答案编号
    private String questiontype_name;//试题类型名称
    private String subjectname;      //学科的名称
    private int choicenum;       //选项的个数
    private String trueanswer;      //题目的正确答案
    private String answerCount;     //标准答案个数
    private String isattach;        //是否有附件
    private String attachStr;       //附件的内容
    private String newanswer;       //新的答案
    private String newscore;        //新的得分
    private int submitTimes;     //提交次数
    
    public static final Parcelable.Creator<IaskuQuestion> CREATOR = new Parcelable.Creator<IaskuQuestion>() {
        // 重写Creator
        @Override
        public IaskuQuestion createFromParcel(Parcel source) {
            IaskuQuestion iq = new IaskuQuestion();
            iq.questionno = source.readString();
            iq.questiontype_id = source.readInt();
            iq.question_score = source.readString();
            iq.total = source.readInt();
            iq.useranswer = source.readString();
            iq.userscore = source.readString();
            iq.answerid = source.readString();
            iq.questiontype_name = source.readString();
            iq.subjectname = source.readString();
            iq.choicenum = source.readInt();
            iq.answerCount = source.readString();
            iq.trueanswer = source.readString();
            iq.isattach = source.readString();
            iq.attachStr = source.readString();
            iq.newanswer = source.readString();
            iq.newscore = source.readString();
            iq.submitTimes = source.readInt();
            return iq;
        }

        @Override
        public IaskuQuestion[] newArray(int size) {
            // TODO Auto-generated method stub
            return null;
        }
    };

    public String getQuestionno() {
        return questionno;
    }

    public void setQuestionno(String questionno) {
        this.questionno = questionno;
    }

    public int getQuestion_type_id() {
        return questiontype_id;
    }

    public void setQuestion_type_id(int question_type_id) {
        this.questiontype_id = question_type_id;
    }

    public String getQuestion_score() {
        return question_score;
    }

    public void setQuestion_score(String question_score) {
        this.question_score = question_score;
    }

    public int getQuestiontype_id() {
        return questiontype_id;
    }

    public void setQuestiontype_id(int questiontype_id) {
        this.questiontype_id = questiontype_id;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public String getUseranswer() {
        return useranswer;
    }

    public void setUseranswer(String useranswer) {
        this.useranswer = useranswer;
    }

    public String getUserscore() {
        return userscore;
    }

    public void setUserscore(String userscore) {
        if("null".equals(userscore)){
            this.userscore = "";
        }
        this.userscore = userscore;
    }

    public String getAnswerid() {
        return answerid;
    }

    public void setAnswerid(String answerid) {
        this.answerid = answerid;
    }

    public String getQuestiontype_name() {
        return questiontype_name;
    }

    public void setQuestiontype_name(String questiontype_name) {
        this.questiontype_name = questiontype_name;
    }

    public String getSubjectname() {
        return subjectname;
    }

    public void setSubjectname(String subjectname) {
        this.subjectname = subjectname;
    }

    public int getChoicenum() {
        return choicenum;
    }

    public void setChoicenum(int choicenum) {
        this.choicenum = choicenum;
    }

    public String getTrueanswer() {
        return trueanswer;
    }

    public void setTrueanswer(String trueanswer) {
        this.trueanswer = trueanswer;
    }

    public String getAnswerCount() {
        return answerCount;
    }

    public void setAnswerCount(String answerCount) {
        this.answerCount = answerCount;
    }

    public String getIsattach() {
        return isattach;
    }

    public void setIsattach(String isattach) {
        this.isattach = isattach;
    }
    
    public String getAttachStr() {
        return attachStr;
    }

    public void setAttachStr(String attachStr) {
        this.attachStr = attachStr;
    }
    
    

    public String getNewanswer() {
        return newanswer;
    }

    public void setNewanswer(String newanswer) {
        this.newanswer = newanswer;
    }

    public String getNewscore() {
        return newscore;
    }

    public void setNewscore(String newscore) {
        this.newscore = newscore;
    }
    
    public int getSubmitTimes() {
        return submitTimes;
    }

    public void setSubmitTimes(int submitTimes) {
        this.submitTimes = submitTimes;
    }

    @Override
    public int describeContents() {
        // TODO Auto-generated method stub
        return 0;
    }
    
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(questionno);
        dest.writeInt(questiontype_id);
        dest.writeString(question_score);
        dest.writeInt(total);
        dest.writeString(useranswer);
        dest.writeString(userscore);
        dest.writeString(answerid);
        dest.writeString(questiontype_name);
        dest.writeString(subjectname);
        dest.writeInt(choicenum);
        dest.writeString(trueanswer);
        dest.writeString(answerCount);
        dest.writeString(isattach);
        dest.writeString(attachStr);
        dest.writeString(newanswer);
        dest.writeString(newscore);
        dest.writeInt(submitTimes);
    }

    @Override
    public String toString() {
        return "IaskuQuestion [questionno=" + questionno + ", questiontype_id=" + questiontype_id + ", question_score="
                + question_score + ", total=" + total + ", useranswer=" + useranswer + ", userscore=" + userscore
                + ", answerid=" + answerid + ", questiontype_name=" + questiontype_name + ", subjectname="
                + subjectname + ", choicenum=" + choicenum + ", trueanswer=" + trueanswer + ", answerCount="
                + answerCount + ", isattach=" + isattach + ", attachStr=" + attachStr + ", newanswer=" + newanswer
                + ", newscore=" + newscore + ", submitTimes=" + submitTimes + "]";
    }

}
